#include <stdio.h>
#include "init.h"
#include "driver/temp_sensor.h"

void temp_init(void)
{
    temp_sensor_config_t temp_sensor = {
        .dac_offset = TSENS_DAC_L2,
        .clk_div = 6,
    };
    temp_sensor_set_config(temp_sensor);
    temp_sensor_start();
}

int get_temp_sensor(void)
{
    static float tsens_out;
    temp_sensor_read_celsius(&tsens_out);
    return (int)(tsens_out*10);
}
